<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>JEESDP - 登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            min-height: 100vh;
            background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
            background-size: 400% 400%;
            animation: gradient 15s ease infinite;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            position: relative;
        }

        /* 粒子容器 */
        #particles-js {
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 0;
        }

        /* 登录框容器 */
        .login-container {
            position: relative;
            z-index: 1;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            width: 400px;
            box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
            border: 1px solid rgba(255, 255, 255, 0.18);
            animation: fadeIn 1s ease-out;
            transition: all 0.3s ease;
        }

        .login-header {
            text-align: center;
            margin-bottom: 30px;
            color: white;
        }

        .login-header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        }

        .login-header p {
            opacity: 0.8;
        }

        .input-group {
            margin-bottom: 25px;
            position: relative;
        }

        .input-group input {
            width: 100%;
            padding: 15px 20px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50px;
            font-size: 1rem;
            color: white;
            transition: all 0.3s ease;
            outline: none;
            border: 1px solid transparent;
        }

        .input-group input:focus {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
        }

        .input-group input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        .btn-login {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 50px;
            background: rgba(255, 255, 255, 0.25);
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 10px;
            letter-spacing: 1px;
        }

        .btn-login:hover {
            background: rgba(255, 255, 255, 0.4);
            transform: translateY(-3px);
            box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);
        }

        .input-group input:focus {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
            transform: scale(1.02);
            transition: all 0.3s ease;
        }

        .footer-links {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
            font-size: 0.9rem;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            transition: opacity 0.3s;
        }

        .footer-links a:hover {
            opacity: 1;
            text-decoration: underline;
        }

        /* 动画定义 */
        @keyframes gradient {
            0% {
                background-position: 0 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0 50%;
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes shake {
            0%, 100% {
                transform: translateX(0);
            }
            20%, 60% {
                transform: translateX(-5px);
            }
            40%, 80% {
                transform: translateX(5px);
            }
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
            100% {
                transform: scale(1);
            }
        }

        .error-message {
            color: #ff9999;
            text-align: center;
            margin-bottom: 15px;
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
<!-- 粒子背景容器 -->
<div id="particles-js"></div>

<!-- 登录表单 -->
<div class="login-container">
    <div class="login-header">
        <h1>JEESDP</h1>
        <p>请登录您的账号</p>
    </div>
    <form action="/login" id="loginForm" method="post">
        <div class="error-message" id="errorMessage" style="display: none;"></div>
        <div class="input-group">
            <label>
                <input id="username" name="username" placeholder="用户名" required type="text">
            </label>
        </div>
        <div class="input-group">
            <label>
                <input id="password" name="password" placeholder="密码" required type="password">
            </label>
        </div>
        <button class="btn-login" type="submit">登 录</button>
    </form>
    <div class="footer-links">
        <a href="#">忘记密码?</a>
        <a href="#">注册账号</a>
    </div>
</div>

<!-- 粒子系统脚本 -->
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script>
    // 初始化粒子系统
    document.addEventListener('DOMContentLoaded', function () {
        particlesJS('particles-js', {
            particles: {
                number: {value: 100, density: {enable: true, value_area: 800}},
                color: {value: "#ffffff"},
                shape: {type: "circle"},
                opacity: {value: 0.5, random: true},
                size: {value: 3, random: true},
                line_linked: {
                    enable: true,
                    distance: 150,
                    color: "#ffffff",
                    opacity: 0.4,
                    width: 1
                },
                move: {
                    enable: true,
                    speed: 2,
                    direction: "none",
                    random: true,
                    straight: false,
                    out_mode: "out",
                    bounce: false
                }
            },
            interactivity: {
                detect_on: "canvas",
                events: {
                    onhover: {enable: true, mode: "grab"},
                    onclick: {enable: true, mode: "push"},
                    resize: true
                },
                modes: {
                    grab: {distance: 140, line_linked: {opacity: 1}},
                    push: {particles_nb: 4},
                    repulse: {distance: 200, duration: 0.4}
                }
            },
            retina_detect: true
        });
    });

    // 表单提交处理
    document.getElementById('loginForm').addEventListener('submit', function (e) {
        e.preventDefault();

        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;
        const errorMessage = document.getElementById('errorMessage');

        // 简单的表单验证
        if (!username || !password) {
            errorMessage.textContent = '请输入用户名和密码';
            errorMessage.style.display = 'block';

            // 添加震动动画效果
            const loginContainer = document.querySelector('.login-container');
            loginContainer.style.animation = 'shake 0.5s';
            setTimeout(() => {
                loginContainer.style.animation = '';
            }, 500);
            return;
        }

        // 这里可以添加实际的登录逻辑
        // 模拟登录过程
        console.log('登录信息:', {username, password});

        // 隐藏错误信息
        errorMessage.style.display = 'none';

        // 添加登录成功动画
        const loginContainer = document.querySelector('.login-container');
        loginContainer.style.animation = 'pulse 1s';

        // 模拟登录成功后的跳转
        setTimeout(() => {
            alert('登录成功！将跳转到主页。');
            // window.location.href = '/dashboard';
        }, 1000);
    });

    // 登录框悬停效果
    const loginContainer = document.querySelector('.login-container');
    loginContainer.addEventListener('mouseenter', function () {
        this.style.transform = 'translateY(-5px)';
        this.style.boxShadow = '0 12px 40px rgba(31, 38, 135, 0.5)';
    });

    loginContainer.addEventListener('mouseleave', function () {
        this.style.transform = 'translateY(0)';
        this.style.boxShadow = '0 8px 32px rgba(31, 38, 135, 0.37)';
    });
</script>
</body>
</html>
